package com.ruike.service.impl;

import com.github.pagehelper.PageHelper;
import com.ruike.mapper.AcademicBuildingMapper;
import com.ruike.pojo.AcademicBuilding;
import com.ruike.service.AcademicBuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 吴泽胜
 * @FileName AcademicBuildingServiceImpl
 * @date 2021-01-18 2:55 下午
 * @Software: IntelliJ IDEA
 */
@Service
public class AcademicBuildingServiceImpl implements AcademicBuildingService {

    @Autowired
    private AcademicBuildingMapper academicBuildingMapper;

    @Override
    public List<AcademicBuilding> getAcademicBuildingList() throws Exception {
        return academicBuildingMapper.getAcademicBuildingList();
    }

    @Override
    public void updataStateById(AcademicBuilding academicBuilding) throws Exception {
        academicBuildingMapper.updataStateById(academicBuilding);
    }

    @Override
    public AcademicBuilding findAcademicBuildingById(Integer id) throws Exception {
        return academicBuildingMapper.findAcademicBuildingById(id);
    }

    @Override
    public void deleteAcademicBuildingById(Integer id) throws Exception {
        academicBuildingMapper.deleteAcademicBuildingById(id);
    }

    @Override
    public void updateAcademicBuildingById(AcademicBuilding academicBuilding) throws Exception {
        academicBuildingMapper.updateAcademicBuildingById(academicBuilding);
    }

    @Override
    public void addAcademicBuilding(AcademicBuilding academicBuilding) throws Exception {
        academicBuildingMapper.addAcademicBuilding(academicBuilding);
    }

    @Override
    public List<AcademicBuilding> getAcademicBuildingListByPageHelper(Integer pageNum, Integer pageSize) throws Exception {
        // 开始分页
        PageHelper.startPage(pageNum,pageSize);
        return academicBuildingMapper.getAcademicBuildingList();
    }

    @Override
    public List<AcademicBuilding> fuzzyAcademicBuildingList(String searchParam) throws Exception {
        return academicBuildingMapper.fuzzyAcademicBuildingList(searchParam);
    }

    @Override
    public List<AcademicBuilding> getIsActiveAcademicBuildingList() throws Exception {
        return academicBuildingMapper.getIsActiveAcademicBuildingList();
    }
}
